package com.ruoyi.center.demo;

import com.ruoyi.common.core.utils.ip.IpUtils;
import com.ruoyi.common.security.annotation.EnableCustomConfig;
import com.ruoyi.common.security.annotation.EnableRyFeignClients;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;

/**
 * 启动类
 *
 * @author ruoyi
 * @date 2022-02-15 10:59:29
 */
@EnableCustomConfig
@EnableRyFeignClients
@SpringBootApplication(scanBasePackages = {"com.ruoyi"})
@Slf4j
@EnableDiscoveryClient
public class CenterBootstrap {
    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(CenterBootstrap.class, args);
        Environment environment = context.getBean(Environment.class);
        System.out.println("demo中心启动成功，接口文档地址：http://" + IpUtils.getHostIp() + ":"
                + environment.getProperty("server.port") + "/doc.html");
        log.info("(♥◠‿◠)ﾉﾞ  demo中心启动成功   ლ(´ڡ`ლ)ﾞ  \n" +
                " .-------.       ____     __        \n" +
                " |  _ _   \\      \\   \\   /  /    \n" +
                " | ( ' )  |       \\  _. /  '       \n" +
                " |(_ o _) /        _( )_ .'         \n" +
                " | (_,_).' __  ___(_ o _)'          \n" +
                " |  |\\ \\  |  ||   |(_,_)'         \n" +
                " |  | \\ `'   /|   `-'  /           \n" +
                " |  |  \\    /  \\      /           \n" +
                " ''-'   `'-'    `-..-'              ");
    }
}
